local skel = fk.CreateSkill {
  name = "#hunting_trigger",
}

skel:addEffect(fk.DamageInflicted, {
  --global = true,
  mute = true,
  priority = 0.01,
  can_trigger = function(self, event, target, player, data)
    return target == player and player:getMark("@!!hunting") > 0 and data.from and not data.from.dead
  end,
  on_cost = Util.TrueFunc,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local n = math.min(data.damage, player:getMark("@!!hunting"))
    room:removePlayerMark(player, "@!!hunting", n)
    data.from:drawCards(n, self.name)
  end,
})

return skel
